Skip to content

Conversation

@ChinmayBansal
Copy link
Contributor

Related Issues

Proposed Changes:

Added delete_all_documents() and delete_all_documents_async() methods to PineconeDocumentStore to enable deletion of all documents from an index namespace.

Implementation details:

Files changed:

How did you test it?

  • Unit tests: hatch run test:unit - 17 passed
  • Integration tests: Added 4 new integration tests (2 sync + 2 async):
    • test_delete_all_documents: Verifies deletion of multiple documents
    • test_delete_all_documents_empty_collection: Verifies behavior with empty collection
    • test_delete_all_documents_async: Async version with multiple documents
    • test_delete_all_documents_async_empty_collection: Async version with empty collection

Notes for the reviewer

  • Implementation follows the pattern established in OpenSearch PR feat: adding the operation delete_all_documents to the OpenSearchDocumentStore #2321 (reference implementation for parent issue #8508)
  • Uses Pinecone's native delete_all=True parameter which efficiently deletes all vectors in the specified namespace
  • Consistent with existing delete_documents() method in the same file
  • No recreate_index parameter needed - Pinecone handles index management differently than search engines

Checklist

@ChinmayBansal ChinmayBansal requested a review from a team as a code owner October 18, 2025 19:08
@ChinmayBansal ChinmayBansal requested review from mpangrazzi and removed request for a team October 18, 2025 19:08
@github-actions github-actions bot added integration:pinecone type:documentation Improvements or additions to documentation labels Oct 18, 2025
@mpangrazzi mpangrazzi changed the title feat: add delete all documents to Pineconde DocumentStore feat: add delete all documents to Pinecone DocumentStore Oct 30, 2025
Copy link
Contributor

@mpangrazzi mpangrazzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Not sure if you have tested it, but it seems that Pinecone APIs are returning a 404 when you're trying to delete all documents from an empty collection:

pinecone.exceptions.exceptions.NotFoundException: (404)
HTTP response body: {"code":5,"message":"Namespace not found","details":[]}

So I would catch this kind of exceptions. WDYT?

@ChinmayBansal
Copy link
Contributor Author

@mpangrazzi, I have added a check for this. I am unsure of why this did not happen the first time.
Let me know if more checks are needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration:pinecone type:documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add delete_all_documents() operation to PineconeDocumentStore

2 participants